{%extends 'myadmin/public/base.html' %}

{% block con-header %}
<div class="container-fluid am-cf">
    <div class="row">
        <div class="am-u-sm-12 am-u-md-12 am-u-lg-9">
            <div class="page-header-heading"><span class="am-icon-home page-header-heading-icon"></span>会员添加</div>
           
        </div>
        <div class="am-u-lg-3 tpl-index-settings-button">
            <button type="button" class="page-header-button"><span class="am-icon-paint-brush"></span> 设置</button>
        </div>
    </div>

</div>
{%endblock%}
{%block con-body%}
<div class="row am-cf">

<div class="widget am-cf">


        <div class="widget-body am-fr">

            <form class="am-form tpl-form-line-form" action="{% url 'admin_goods_insert' %}" method="post" enctype="multipart/form-data" >

             <div class="am-form-group">
                            <label for="user-name" class="am-u-sm-3 am-form-label">
                                所属分类
                            </label>
                            <select name="typeid" data-am-selected="{btnSize: 'sm'}" style="display: none;">
                              {% for v in tlist %}
                                  {% if v.pid == 0 %}
                                    <option disabled value="{{ v.id }}">{{ v.name }}</option>
                                  {% else %}
                                    <option value="{{ v.id }}">{{ v.name }}</option>
                                  {% endif %}
                              {% endfor %}
                            </select>
                </div>




                <div class="am-form-group">
                    <label for="user-name" class="am-u-sm-3 am-form-label" >商品介绍</label>
                    
                    <div class="am-u-sm-9">
                        <input class="tpl-form-input username" id="user-name" placeholder="title" type="text"  name="title">
                        
                    </div>
                </div>

               <div class="am-form-group">
                    <label for="user-name" class="am-u-sm-3 am-form-label" >价格</label>
                    
                    <div class="am-u-sm-9">
                        <input class="tpl-form-input username" id="user-name" placeholder="price" type="text"  name="price">
                        
                    </div>
                </div>
                
                <div class="am-form-group">
                    <label for="user-name" class="am-u-sm-3 am-form-label" >库存</label>
                    
                    <div class="am-u-sm-9">
                        <input class="tpl-form-input username" id="user-name" placeholder="storage" type="text"  name="storage">
                        
                    </div>
                </div>
                



                <div class="am-form-group">
                    <label for="user-weibo" class="am-u-sm-3 am-form-label">商品图片 </label>
                    <div class="am-u-sm-9">
                        <div class="am-form-group am-form-file">
                            <div class="tpl-form-file-img">
                                <img src="/static/pics/default/default.jpg" class="imgg" alt="" style="width: 100px">
                            </div>
                            <button type="button" class="am-btn am-btn-danger am-btn-sm">
                        <i class="am-icon-cloud-upload" ></i> 添加商品图片</button>
                            <input id="doc-form-file" multiple="" type="file" name="pic" >
                        </div>

                    </div>
                </div>

                 <div class="am-form-group">
                            <label for="user-name" class="am-u-sm-3 am-form-label">
                                商品详情
                            </label>
                            <div class="am-u-sm-9">
                                <link rel="stylesheet" type="text/css" href="/ueditor/UE/third-party/SyntaxHighlighter/shCoreDefault.css">
                                <script type="text/javascript" src="/ueditor/UE/third-party/SyntaxHighlighter/shCore.js"></script>
                                <script type="text/javascript" src="/ueditor/UE/ueditor.config.js"></script>
                                <script type="text/javascript" src="/ueditor/UE/ueditor.all.min.js"></script>
                                <script type="text/javascript" src="/ueditor/UE/lang/zh-cn/zh-cn.js"></script>

                                <script id="editor" name="info" type="text/plain" style="height:300px; width:350px;color:#000;">
                                    请输入商品详情内容
                                </script>
                                
                                <script type="text/javascript">
                                   var ue = UE.getEditor('editor');
                                   SyntaxHighlighter.all();
                                </script>
                            </div>
                 </div>



                <div class="am-form-group">
                    <div class="am-u-sm-9 am-u-sm-push-3">
                        <button type="sublit" id="but" class="am-btn am-btn-primary tpl-btn-bg-color-success ">提交</button>
                    </div>
                </div>
                {% csrf_token %}
           </form>
        </div>
</div>
                
</div>

<script type="text/javascript">
    $('#doc-form-file').change(function(){
        var a = $('.imgg').attr('src',URL.createObjectURL($(this)[0].files[0]));
       
    })

    // $(".username").blur(function(){
    //  var a=$(".username").val()

        
    // })

 
    
    

</script>
{%endblock%}